package com.bjc.base.bean;

import com.bjc.base.core.ResultEnum;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 统一API响应结果封装
 *
 * @author 许自辉
 * @date 2017年9月18日
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class ResultVO {
	/**
	 * 返回编码
	 */
	private Integer code;
	/**
	 * 返回信息
	 */
	private String message;
	/**
	 * 返回信息
	 */
	private Object data;

	
	public ResultVO setCode(Integer code) {
		this.code = code;
		return this;
	}

	public ResultVO setMessage(String message) {
		this.message = message;
		return this;
	}

	public ResultVO setData(Object data) {
		this.data = data;
		return this;
	}
	
	public ResultVO(ResultEnum resultEnum) {
		super();
		this.code = resultEnum.code;
		this.message = resultEnum.message;
	}
	
	public ResultVO(Integer code, String message) {
		super();
		this.code = code;
		this.message = message;
	}


}
